package swust;
import java.util.Arrays;
import java.util.Scanner;
public class Anagram0029 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		while(n-- > 0) {
			String a = scan.next();
			String b = scan.next();
			String[] aa = a.split("");
			String[] bb = b.split("");
			Arrays.sort(aa);
			Arrays.sort(bb);
			int i;
			for(i = 0; i < aa.length; i++) {
				if (!aa[i].equals(bb[i])) {
					System.out.println("No");
					break;
				}
			}
			if (i == aa.length) {
				System.out.println("Yes");
			}
		}
	}
}
